/***************************************************************************
 *   Copyright (C) 2011 by Melker Narikka <meklu95@gmail.com>              *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
 ***************************************************************************/

#include <iostream>
using namespace std;

void answer();
void help();

int main(int argc, char **argv) {
  if (argc >= 2) {
    if (string(argv[1]) == "--help") {
      help();
    }
    else if (string(argv[1]) == "-h") {
      help();
    }
    else {
      answer();
    }
  }
  else {
    answer();
  }
  return 0;
}

void answer() {
  cout << "The answer to life, the universe and everything is 42." << endl;
}

void help() {
  cout << "This program just prints the answer to life and exits. ";
  cout << "It only takes \"--help\" (or \"-h\") as an argument and ignores everything else thrown at it." << endl;
}
